package test3.A1_3;

import java.util.HashSet;
import java.util.Set;

//代表指导教师的类

class Instructor {
    private String name; // 指导教师名称
    private Department department; // 指导教师所属的系
    private Set<Subject> courses; // 指导教师教授的课程

    //构造函数
    public Instructor(String name) {
        this.name = name;
        this.courses = new HashSet<>();
    }

    //分配课程给指导教师
    public void assignCourse(Subject course) {
        courses.add(course);
        course.setInstructor(this); // 设置课程的指导教师
    }

    //设置指导教师所属的系
    public void setDepartment(Department department) {
        this.department = department;
    }

    //获取指导教师教授的所有课程
    public Set<Subject> getCourses() {
        return courses;
    }
}